﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace WhiteFlow.DevTrackingTool.UI.Converters
{
    public class CurrencyToLanguageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return "DOLLAR";

            switch (value.ToString())
            {
                case "en-US":
                    return "DOLLAR";
                case "it-IT":
                    return "EURO";
                default:
                    return "DOLLAR";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return "en-US";

            switch (value.ToString())
            {
                case "DOLLAR":
                    return "en-US";
                case "EURO":
                    return "it-IT";
                default:
                    return "en-US";
            }
        }
    }
}